package com.deepocean.service.impl;

import com.deepocean.dao.GradingScreenDao;
import com.deepocean.entity.GradingScreenCondition;
import com.deepocean.entity.GradingScreenEntity;
import com.deepocean.entity.GradingScreenInAndOut1Hour;
import com.deepocean.service.IGradingScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class GradingScreenServiceImpl implements IGradingScreenService {
    @Autowired
    private GradingScreenDao gradingScreenDao;
    @Override
    public boolean add(GradingScreenEntity gradingScreenEntity) {
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        gradingScreenEntity.setId(id);
            return gradingScreenDao.add(gradingScreenEntity);
    }

    @Override
    public GradingScreenInAndOut1Hour getInAndOutInHour(String deviceId) {
        return gradingScreenDao.getInAndOutInHour(deviceId);
    }

    @Override
    public List<GradingScreenEntity> getGradingScreenByCondition(GradingScreenCondition gradingScreenCondition) {
        return gradingScreenDao.getGradingScreenByCondition(gradingScreenCondition);
    }
}
